import 'package:flutter_test/flutter_test.dart';
import 'package:top_foundation/top_foundation.dart';
import 'package:top_foundation/top_foundation_platform_interface.dart';
import 'package:top_foundation/top_foundation_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockTopFoundationPlatform
    with MockPlatformInterfaceMixin
    implements TopFoundationPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final TopFoundationPlatform initialPlatform = TopFoundationPlatform.instance;

  test('$MethodChannelTopFoundation is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelTopFoundation>());
  });

  test('getPlatformVersion', () async {
    TopFoundation topFoundationPlugin = TopFoundation();
    MockTopFoundationPlatform fakePlatform = MockTopFoundationPlatform();
    TopFoundationPlatform.instance = fakePlatform;

    expect(await topFoundationPlugin.getPlatformVersion(), '42');
  });
}
